import { PageParamsModel } from "@/model/page-params-model";

const adminListOptions: object = {
  searchShowBtn: true,
  align: "center",
  menuAlign: "center",
  selection: false,
  viewBtn: true,
  editBtn: false,
  delBtn: true,
  addBtn: false,
  searchMenuSpan: 5,
  column: [
    {
      label: "ID",
      prop: "id",
      width: 50,
      disabled: true,
    },
    {
      label: "头像",
      width: 100,
      prop: "avatar",
      type: "upload",
      alone: true,
      accept: "image/*",
      limit: 1,
      httpRequest: (file: any, column: any) => {
        console.log(file, column);
      },
    },

    {
      label: "姓名",
      prop: "name",
      width: 200,
      search: true,
      searchLabelWidth: 100,
    },
    {
      label: "账号",
      prop: "username",
      width: 200,
      search: true,
      searchLabelWidth: 100,
    },

    {
      label: "手机号",
      prop: "mobile",
      width: 120,
      search: true,
      searchLabelWidth: 100,
    },

    {
      label: "状态",
      prop: "status",
      width: 100,
      type: "select",
      dicData: [
        {
          label: "启用",
          value: 1,
        },
        {
          label: "禁用",
          value: 0,
        },
      ],
    },

    {
      label: "角色",
      prop: "role_name",
      width: 120,
    },

    {
      label: "登录时间",
      prop: "login_time",
      type: "date",
      disabled: true,
    },

    {
      label: "创建时间",
      prop: "create_time",
      type: "date",
      search: true,
      searchRange: true,
      searchLabelWidth: 100,
      disabled: true,
    },
  ],
};

export default adminListOptions;

export class AdminListSearchModel extends PageParamsModel {
  name?: string = "";
  username?: string = "";
  mobile?: string = "";
  create_time?: string[] = [];
}
